import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

@Component({
  selector: 'app-pagination',
  templateUrl: './pagination.component.html',
  styleUrls: ['./pagination.component.scss']
})
export class PaginationComponent implements OnInit {
  @Input() total: number;
  @Input() pageNo: number;
  @Input() pageSize: number;
  @Input() totalPages: number;
  @Output() pageNoChange: EventEmitter<number> = new EventEmitter<number>();
  @Output() pageSizeChange: EventEmitter<number> = new EventEmitter<number>();
  constructor() { }

  ngOnInit() {
  }
  setPageSize(pageSize){
    this.pageSizeChange.emit(pageSize);
  }
  goToPage(pageNo){
    this.pageNoChange.emit(pageNo);
  }
}
